package com.br.homebank.main;

import java.util.ArrayList;
import java.util.List;

import javax.swing.JComboBox;
import javax.swing.JDialog;

import com.br.generateswingview.core.GVUtils;
import com.br.generateswingview.core.GView;
import com.br.homebank.entities.Account;
import com.br.homebank.entities.Client;
import com.br.homebank.entities.CurrentAccount;

public class Main {

	private static List<Account> accounts;
	private static List<Client> clients = new ArrayList<Client>();

	public static void main( String[] args ) throws SecurityException, NoSuchFieldException {
		Client cliente = new Client( "" );
		JDialog frame = GView.getView( cliente );
		frame.setVisible( true );
		clients.add( cliente );
		CurrentAccount currentAccount = new CurrentAccount( cliente );
		frame = GView.getView( currentAccount );
		JComboBox box = (JComboBox) GVUtils.getElementByName( frame, "client" );
		
		for ( Client c : clients ) {
			box.addItem( c );
		}
		
		frame.setVisible( true );
		System.out.println( currentAccount);
	}
}
